// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/*

WIP: Package parser ...

Every Node
 .Pos
 .Op

OAS
 .NL lhs
 .NR rhs

OAS2
 .LL lhs
 .LR rhs

OASOP
 .NL: lhs
 .NR: rhs
 .AsOpTok: operation, see scanner.l

OBLOCK
 .LL: []statement

OBREAK
 .NL: node_onew_name(=0NAME/nil): label in 'break label'

OCALL
 .NL: x in x(args)
 .LL: args

OCASE
 (a) LCASE list_expr_or_type_list ':'
 (b) LCASE list_expr_or_type_list '=' node_expr ':'
 (c) LCASE list_expr_or_type_list LCOLAS node_expr ':'
 (d) LDEFAULT ':'
 ----
 .NL: OAS/OAS2 (b, c)
 .LL: list_expr_or_type_list (a)

OCLOSURE
 .NL: OTFUNC
 .LL: list_stmt_list: body

OCOMPLIT
 .NL: type
 .LL: list_braced_keyval_list

OCONTINUE
 .NL: label in 'continue label'

ODCL (means ODCLVAR)
 .NL: node_ntype: type of decl vars
 .LL: list_dcl_name_list: declared names
 .LR: list_expr_list: initializer expresions

ODCLCONST
 .NL: node_ntype: type of decl consts
 .LL: list_dcl_name_list: declared names
 .LR: list_expr_list: expresions

ODCLFIELD
 .Literal: "foo" in 'struct { fld typ "foo" }'
 .NL: ONAME(method) in 'interface{ method(args) }'
 .NR: typ in 'struct { fld typ }'/fntype of method
 .LL: field_list(a, b) in 'struct { a, b typ}'

ODCLFUNC
 .NL: ONAME
 .NR: OTFUNC
 .LL: list_fnbody

ODCLTYPE
 .NL: ONAME: declaret type name
 .NR: type TypeSpec 

ODDD
 .NL: type

ODEC
 .NL: node_expr

ODEFER
 .NL: OCALL

ODOTTYPE
 .NL: expr in 'expr.(T)'
 .NR: T

OFALL
 -nothing-

OFOR
 .NL: node_osimple_stmt: init
 .NR: node_osimple_stmt: cond
 .N3: node_osimple_stmt: incr

OGOTO
 .NL: label in 'goto label'

OIF:
 .NL: node_osimple_stmt, init 'if init; cond'
 .NR: node_osimple_stmt, cond 'if cond'
 .N3: node_if_stmt/node_compound_stmt: else part
 .LL: list_stmt_list 'for x { list_stmt_list }'

OINC
 .NL: node_expr

OINDEX
 .NL: expr in 'expr[index]'
 .NR: index

OKEY
 .NL
 .NR

OLABEL
 .NL: ONAME
 .NR: stmt in 'label: stmt'

OLITERAL
 .Literal

ONAME
 .Name

OADD
OAND
OANDAND
OANDNOT
ODIV
OEQ
OGE
OGT
OLE
OLSH
OLT
OMOD
OMUL
ONE
OOR
OOROR
ORSH
OSEND
OSUB
OXOR
 .NL node_expr
 .NR node_expr

OADDR
OCOM
OIND
OMINUS
ONOT
OPLUS
 .NL

OPAREN
 .NL: expr in '(expr)'

OPROC
 .NL: node_pseudocall: OCALL:

ORANGE
 .NL: node_expr: rhs(e3) in 'range e1, e2 = range e3 {}'
 .LL: list_expr_list: lhs(e1, e2) in 'range e1, e2 = range e3 {}'

ORECV
 .NL: node_uexpr '<-node_uexpr'

ORETURN
 .LL: list_oexpr_list: explist in 'return explist'

OSELECT
 .LL: list_caseblock_list(=[]node_caseblock)

OSLICE
 .NL: expr in 'expr[a:b]'
 .NR: OKEY(a, b)

OSWITCH:
 .NL: node_osimple_stmt, init 'switch init; cond'
 .NR: node_osimple_stmt, cond 'switch cond'
 .LL: list_caseblock_list(=[]node_caseblock)

OTARRAY
 .NL: expr in '[expr]type'
 .NR: type

OTCHAN
 .CType: parser.CType: channel direction
 .NL: item in 'chan item'

OTFUNC
 .LL: list_oarg_type_list_ocomma: method rcvr
 .LR: list_oarg_type_list_ocomma: parameters
 .L3: list_fnres: result

OTINTER
 .LL: list_interfacedcl_list(=[]node_interfacedcl)

OTMAP
 .NL tkey in 'map[tkey]tvalue
 .NR tvalue

OTPAREN
 .NL: type

OTSTRUCT
 .LL: list_structdcl_list

OTYPE
 .Type

OTYPESW
 .NL: ONAME: x in 'x := y.(type)'.
 .NR: expr in 'expr.(type)

OXDOT
 .NL: expr in 'expr.name'
 .NR: ONAME: name

Monotyped productions

 list_caseblock_list: []node_caseblock
 list_constdcl1:      []ODCLCONST
 list_constdcl:       []ODCLCONST
 list_vardcl:         []ODCL
 node_case:           OCASE
 node_fndcl:          ODCLFUNC
 node_if_header:      OIF
 node_keyval:         OKEY
 node_name:           ONAME
 node_pseudocall:     OCALL
 node_typedcl:        ODCLTYPE
 node_typedclname:    ONAME
 node_xfndcl:         ODCLFUNC
 node_compound_stmt:  OBLOCK
 ------------------------------
 list_loop_body:      list_stmt_list
 list_stmt_list:      node_stmt

*/
package parser
